﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace IURIP
{
    /// <summary>
    /// The target interface. A target means one type of data structure for destination system, it may be a type of page, a type of datarow and so on.
    /// </summary>
    public interface ITarget
    {
        /// <summary>
        /// Gets the target name
        /// </summary>
        string Name { get; }
        /// <summary>
        /// Gets if the target is single or not. "true" means this type target only have one instance. e.g.the summary/sitemap page for a website is single
        /// </summary>
        bool IsSingle { get; }
        /// <summary>
        /// Gets if the target is dependent or not. "true" means this type of target should be generate by other related targets. URIP will not act this type of target as a start point.
        /// </summary>
        bool IsDependent { get; }
        /// <summary>
        /// Gets the task
        /// </summary>
        ITask Task { get; }
        /// <summary>
        /// Gets the datablocks defined in the target
        /// </summary>
        Dictionary<string, IDataBlock> DataBlocks { get; }
        /// <summary>
        /// Gets the map defined in the target
        /// </summary>
        IMap Map { get; }

        /// <summary>
        /// Gets the process template defined in the target
        /// </summary>
        IProcessTemplate ProcessTemplate { get; }

        /// <summary>
        /// Initialize template from configuration file
        /// </summary>
        /// <param name="node"></param>
        void InitByConfiguration(XmlNode node);
    }
}
